package tij4.concurrent.exercise.ex11;

import java.util.Random;

public class P11Main01 extends Practice01{
    private int min = 0;
    private int max = 0;
    private int[] range = {min, max};
    private Random random = new Random();

    @Override
    public synchronized int[] next() {
        min = random.nextInt(100);
        max = random.nextInt(100);
        Thread.yield();
        if(min > max) max = min;
        int[] ia = {min, max};
        return ia;
    }

    public static void main(String[] args) {
        Practice01Checker.test(new P11Main01());
    }
}